#ifndef PAINTMASKMENU_H
#define PAINTMASKMENU_H

#include <QtGui>
#include <QGLViewer/qglviewer.h>
using namespace qglviewer;

class Viewer;

class PaintMaskMenu
{
 public :
  PaintMaskMenu();
  ~PaintMaskMenu();

  void reset();

  int tag() { return m_tag; }
  int thickness() { return m_thickness; }
  bool paintArea() { return m_paintArea; }
  float depthThreshold() { return m_depthThreshold; }
  int dradius() { return m_dradius; }

  void setViewer(Viewer *viewer) { m_Viewer = viewer; }
  void drawMenu();

  bool menuActive();
  bool processKey(QKeyEvent*);
  
  void togglePaintArea() { m_paintArea = !m_paintArea; }
  bool checkPaintArea(int, int);
  bool checkTag(int, int);
  bool checkThickness(int, int);
  bool checkDThreshold(int, int);
  bool checkDRadius(int, int);
  
 private :
  Viewer *m_Viewer;

  int m_tag;
  int m_thickness;
  bool m_paintArea;
  float m_depthThreshold;
  int m_dradius;

  bool m_paintAreaActive;
  bool m_tagActive;
  bool m_thicknessActive;
  bool m_dthreshActive;
  bool m_dradiusActive;
  float m_number;
  QString m_numberText;

  QRect m_tagRect;
  QRect m_thicknessRect;
  QRect m_paintAreaRect;
  QRect m_dthreshRect;
  QRect m_dradiusRect;

};

#endif
